#!/usr/bin/env python3
# coding=utf-8

import rospy
from std_msgs.msg import String

def callBack(msg):
    rospy.loginfo(msg.data)
    ask_pub.publish(msg)

if __name__ == "__main__":
    rospy.init_node('str_pub')
    rospy.sleep(1)  # 等待节点初始化
    # 发布者
    ask_pub = rospy.Publisher("/wpr_ask", String, queue_size=10)
    rospy.sleep(0.1)
    # 订阅话题
    rospy.Subscriber('voiceWords', String, callBack)


    rospy.spin()
